# Definition for singly-linked list.
class ListNode:
    def __init__(self, x):
        self.val = x
        self.next = None


head=ListNode(1)
head.next=ListNode(3)
head.next.next=ListNode(2)
def reversePrint(head: ListNode) :

    t=[]
    while head:
        t.append(head.val)
        head=head.next
    t.reverse()
    return t

print(reversePrint(head))